<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<title>首页</title>
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../css/app.css" />
		<link rel="stylesheet" type="text/css" href="../fonts/iconfont/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="../css/pullToRefresh.css" />
		<link rel="stylesheet" type="text/css" href="../swiper/swiper-3.4.2.min.css"/>
		<link rel="stylesheet" type="text/css" href="../css/global.css" />
		<link rel="stylesheet" type="text/css" href="../css/home.css" />
		<link rel="stylesheet" href="../css/loading-bar.css" />
	</head>
	<body ng-app="homeApp" ng-controller="homeController">
		<header class="mui-bar mui-bar-nav bg_white">
			<h1 class="mui-title">
			    <div class="mui-segmented-control">
			        <a class="mui-control-item mui-active sp_fonts" href="#itemA">社区</a>
			        <a class="mui-control-item sp_fonts" id="bussiness" href="#itemB">交易</a>
			    </div>
		    </h1>
			<a onclick="openNewPage('search_result.html')" class="mui-icon iconfont mui-pull-right">&#xe64f;</a>
		</header>
		<div class="mui-content">
			<!-----------------社区---------------->
			<div id="itemA" class="mui-control-content mui-active">
				<div class="content_box" id="nav">
					<div class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted bg_white">
						<a class="mui-control-item mui-active sp_fonts">无<i class="mui-icon iconfont">&#xe621;</i>二</a>
						<a class="mui-control-item sp_fonts">古<i class="mui-icon iconfont">&#xe621;</i>技</a>
						<a class="mui-control-item sp_fonts">洋<i class="mui-icon iconfont">&#xe621;</i>艺</a>
						<a class="mui-control-item sp_fonts">觉<i class="mui-icon iconfont">&#xe621;</i>今</a>
					</div>
					<div class="mui-control-content mui-active">
						<ul class="mui-table-view">
							<!--轮播图-->
							<li class="mui-table-view-cell padding0 margin-bottom5px">
								<div class="mui-slider">
									<div class="mui-slider-group mui-slider-loop">
										<!-- 额外增加的一个节点(循环轮播：第一个节点是最后一张轮播) -->
										<div class="mui-slider-item mui-slider-item-duplicate slider_wrap" ng-if="index==photos.length-1" ng-repeat="(index,pic) in photos">
											<a href="#"><img ng-src="{{pic.img_add}}"></a>
										</div>
										<!-- 轮播图片循环体 -->
										<div class="mui-slider-item  slider_wrap" ng-repeat="(index,pic) in photos">
											<a href="#"><img ng-src="{{pic.img_add}}"></a>
										</div>
										<!-- 额外增加的一个节点(循环轮播：最后一个节点是第一张轮播) -->
										<div class="mui-slider-item mui-slider-item-duplicate  slider_wrap" ng-if="index==0" ng-repeat="(index,pic) in photos">
											<a href="#"><img ng-src="{{pic.img_add}}"></a>
										</div>
									</div>
									<div class="mui-slider-indicator">
										<div class="mui-indicator mui-active" ng-if='index==0' ng-repeat="(index,pic) in photos"></div><div class="mui-indicator" ng-if='index!=0' ng-repeat="(index,pic) in photos"></div>
									</div>
								</div>
							</li>
							<!--专题-->
							<div class="swiper-container bg_white" ng-if="show_topic">
					        	<div class="swiper-wrapper subfield">
									<div class="swiper-slide bg_white" ng-repeat="(key1,topic) in topic_info">
										<div ng-click="open_special_topic(topic.id,topic.title)" class="zt_item">
											<img ng-src="{{topic.img}}" />
											<p><a>{{topic.title}}</a></p>
										</div>
									</div>
								</div>
							</div>
							<!--最新内容-->
							<li class="mui-table-view-cell bg_white">
								<span class="mui-pull-left color0">最新内容</span>
								<span class="mui-btn mui-btn-link mui-btn-nav padding0 color0" ng-if="new.length >= 10" ng-click="shequNote(item_num,0)">更多</span>
							</li>
							<li class="mui-table-view-cell padding0 bg_white">
								<ul class="mui-table-view">
									<li id="item_open" class="mui-table-view-cell mui-media" ng-if="n1.hot==0" ng-repeat="(index,n1) in new">
										<a href="javascript:;" class="mui-clearfix" ng-click="shequ(n1.uid,n1.file_type,n1.id)">
											<div class="mui-media-object mui-pull-right margin_tb_8px">
												<img ng-if="n1.file_type==0" ng-src="{{n1.subject}}">
												<img ng-if="n1.file_type==1" ng-src="../img/video.png" style="background: #000;"/>
											</div>
											<ul class="mui-media-body mui-pull-left user_view" style="width: calc(100% - 150px);">
												<li>
													<div class="user_pic"><img ng-src="{{n1.icon}}" /></div>
													<span class="padding_l u_name">{{n1.nick}}</span>
													<i class="sign_tag" ng-if="n1.isSign">签约</i>
												</li>
												<li>
													<i class="iconfont mui-icon icon-color" ng-if="n1.file_type == 0">&#xe615;</i>
													<i class="iconfont mui-icon icon-color" ng-if="n1.file_type == 1">&#xe8b3;</i>
													<span class="padding_l">{{n1.title}}</span>
												</li>
												<li>
													<i class="iconfont mui-icon icon-color">&#xe60a;</i>
													<span class="padding_l">{{n1.tags}}</span>
												</li>
											</ul>
										</a>
									</li>
								</ul>
							</li>
							<!--最热门内容-->
							<li class="mui-table-view-cell bg_white">
								<span class="mui-pull-left color0">最热门内容</span>
								<span class="mui-btn mui-btn-link mui-btn-nav padding0 color0" ng-if="hot.length >= 10"  ng-click="shequNote(item_num,1)">更多</span>
							</li>
							<li class="mui-table-view-cell padding0 bg_white">
								<ul class="mui-table-view" id="news1">
									<li class="mui-table-view-cell mui-media" ng-repeat="(index,n11) in hot" ng-if="n11.hot">
										<a href="javascript:;" class="mui-clearfix" ng-click="shequ(n11.uid,n11.type,n11.id)">
											<div class="mui-media-object mui-pull-right margin_tb_8px">
												<img ng-if="n11.file_type==0" ng-src="{{n11.subject}}">
												<img ng-if="n11.file_type==1" ng-src="../img/video.png"  style="background: #000;"/>
											</div>
											<ul class="mui-media-body mui-pull-left user_view">
												<li>
													<div class="user_pic"><img ng-src="{{n11.icon}}" /></div>
													<span class="padding_l">{{n11.nick}}</span>
													<i class="sign_tag" ng-if="n11.isSign">签约</i>
												</li>
												<li>
													<i class="iconfont mui-icon icon-color" ng-if="n11.file_type == 0">&#xe615;</i>
													<i class="iconfont mui-icon icon-color" ng-if="n11.file_type == 1">&#xe8b3;</i>
													<span class="padding_l">{{n11.title}}</span>
												</li>
												<li>
													<i class="iconfont mui-icon icon-color">&#xe60a;</i>
													<span class="padding_l">{{n11.tags}}</span>
												</li>
											</ul>
										</a>
									</li>
								</ul>
							</li>
						</ul>
					</div>
					
				</div>
			</div>
			<!---------------------交易---------------------->
			<div id="itemB" class="mui-control-content">
				<ul class="mui-table-view">
					<!--轮播图-->
					<li class="mui-table-view-cell padding0">
						<div class="mui-slider">
							<div class="mui-slider-group mui-slider-loop">
								<!-- 额外增加的一个节点(循环轮播：第一个节点是最后一张轮播) -->
								<div class="mui-slider-item mui-slider-item-duplicate slider_wrap" ng-if='index==photos.length-1' ng-repeat="(index,pho) in carousels">
									<a href="#">
										<img ng-src="{{pho.img_add}}">
									</a>
								</div>
								<!-- 轮播图片循环体 -->
								<div class="mui-slider-item  slider_wrap" ng-repeat="(index,pho) in carousels">
									<a href="#">
										<img ng-src="{{pho.img_add}}">
									</a>
								</div>
								<!-- 额外增加的一个节点(循环轮播：最后一个节点是第一张轮播) -->
								<div class="mui-slider-item mui-slider-item-duplicate  slider_wrap" ng-if='index==0' ng-repeat="(index,pho) in carousels">
									<a href="#">
										<img ng-src="{{pho.img_add}}">
									</a>
								</div>
							</div>
							<div class="mui-slider-indicator">
								<div class="mui-indicator mui-active" ng-if='index==0' ng-repeat="(index,pic4) in photos"></div><div class="mui-indicator" ng-if='index!=0' ng-repeat="(index,pic4) in photos"></div>
							</div>
						</div>
					</li>
					<!--分栏-->
					<li class="paddingl_r_15px_tb11px border-bottom mui-grid-view circle_text sp_fonts">
						<div onclick="openPage('cate.html',{type:1,name:'独'})"><span>独</span></div>
						<div onclick="openPage('cate.html',{type:2,name:'古'})"><span>古</span></div>
						<div onclick="openPage('cate.html',{type:3,name:'今'})"><span>今</span></div>
						<div onclick="openPage('cate.html',{type:4,name:'中'})"><span>中</span></div>
						<div onclick="openPage('cate.html',{type:5,name:'外'})"><span>外</span></div>
					</li>
					<!--商品推荐-->
					<li class="mui-table-view-cell bg_white">
						<h5 class="mui-pull-left color0">推荐</h5>
						<span class="mui-btn mui-btn-link mui-btn-nav padding0 color0" ng-if="recommends.length >= 8" ng-click="tradeNew('recommend','推荐')">更多</span>
					</li>
					<li class="mui-table-view-cell mui-media bg_white" ng-repeat="(index,r) in recommends">
						<a href="javascript:;" ng-click="obtainId(r.uid,r.type,r.id)">
							<div class="mui-media-object mui-pull-left goods_pic ">
								<img ng-src="{{r.good_image}}">
								<span class="original_tag" ng-if="r.origin">原创</span>
							</div>
							<div class="mui-media-body">
								<div class="mui-ellipsis">{{r.good_name}}</div>
								<div class="mui-clearfix"><span class="mui-pull-right colorP font12 line-height20px">工期：<i>{{r.maf_time}}</i>天</span></div>
								<div class="mui-clearfix">
									<div class="mui-pull-left user">
										<div class="user_pic"><img ng-src="{{r.user_icon}}" /></div>
										<span class="padding_l line-height30px color999 mui-ellipsis font12">{{r.user_nick}} </span>
									</div>
									<span class="mui-pull-right colorRed line-height30px font12">￥{{r.price}}</span>
								</div>
							</div>
						</a>
					</li>
					<!--最新商品-->
					<li class="mui-table-view-cell bg_white">
						<h5 class="mui-pull-left color0">新品</h5>
						<span class="mui-btn mui-btn-link mui-btn-nav padding0 color0" ng-click="tradeNew('new','新品')"ng-if="news.length >= 8">更多</span>
					</li>
					<li class="mui-table-view-cell mui-media bg_white" ng-repeat="(index,news) in news">
						<a href="javascript:;" ng-click="obtainId(news.uid,news.type,news.id)">
							<div class="mui-media-object mui-pull-left goods_pic "><img ng-src="{{news.good_image}}">
								<span class="original_tag" ng-if="news.origin">原创</span>
							</div>
							<div class="mui-media-body">
								<div class="mui-ellipsis">{{news.good_name}}</div>
								<div class="mui-clearfix"><span class="mui-pull-right colorP font12 line-height20px">工期：<i>{{news.maf_time}}</i>天</span></div>
								<div class="mui-clearfix">
									<div class="mui-pull-left user">
										<div class="user_pic"><img ng-src="{{news.user_icon}}" /></div>
										<span class="padding_l line-height30px color999 mui-ellipsis font12">{{news.user_nick}} </span>
									</div>
									<span class="mui-pull-right colorRed line-height30px font12">￥{{news.price}}</span>
								</div>
							</div>
						</a>
					</li>
					<!--热门商品-->
					<li class="mui-table-view-cell bg_white">
						<h5 class="mui-pull-left color0">热门</h5>
						<span class="mui-btn mui-btn-link mui-btn-nav padding0 color0" ng-if="hots.length>=8" ng-click="tradeNew('hot','热门')">更多</span>
					</li>
					<li class="mui-table-view-cell mui-media bg_white" ng-repeat="(index,h) in hots">
						<a href="javascript:;" ng-click="obtainId(h.uid,h.type,h.id)">
							<div class="mui-media-object mui-pull-left goods_pic "><img ng-src="{{h.good_image}}">
								<span class="original_tag" ng-if="h.origin">原创</span>
							</div>
							<div class="mui-media-body">
								<div class="mui-ellipsis">{{h.good_name}}</div>
								<div class="mui-clearfix"><span class="mui-pull-right colorP font12 line-height20px">工期：<i>{{h.maf_time}}</i>天</span></div>
								<div class="mui-clearfix">
									<div class="mui-pull-left user">
										<div class="user_pic"><img ng-src="{{h.user_icon}}" /></div>
										<span class="padding_l line-height30px color999 mui-ellipsis font12">{{h.user_nick}} </span>
									</div>
									<span class="mui-pull-right colorRed line-height30px font12">￥{{h.price}}</span>
								</div>
							</div>
						</a>
					</li>
				</ul>
			</div>
		</div>
	</body>
	<script src="../js/mui.min.js"></script>
	<script src="../js/mui.pullToRefresh.js"></script>
	<script src="../js/mui.pullToRefresh.material.js"></script>
	<script src="../js/open.js"></script>
	<script src="../js/jquery.min.js"></script>
	<script src="../js/apppublic.js"></script>
	<script src="../js/angular.min.js"></script>
	<script src="../js/loading-bar.js"></script>
	<script src="../swiper/swiper-3.4.2.min.js"></script>
	<script src="../js/app/home.js"></script>
	<script src="../js/release_type.js"></script>
	<script type="text/javascript">
		var mySwiper = new Swiper('.swiper-container', {
			slidesPerView: 3,
			observer: true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents: true//修改swiper的父元素时，自动初始化swiper
		})	
	</script>
	<script type="text/javascript">
		//图片轮播
//		mui.init({ swipeBack: true }); //启用右滑关闭功能
		mui(".mui-slider").slider({interval: 5000});
		$(function() {
			//点击监测"社区（无二、古技、洋艺、觉今）"每一个板块内容的高度
			$('#itemA .mui-control-item').on('tap', function() {
				item_num = $(this).index() + 1;
				$scope.initNote();
				setTimeout(function() {
					$('#nav').css({ 'height': ($('#itemA .mui-control-content').innerHeight() + 42) + 'px' });
				}, 500);
			})
		})
  
	</script>
	<script type="text/javascript">	
		(function($) {
			//阻尼系数
			var deceleration = mui.os.ios ? 0.003 : 0.0009;
			$('.mui-scroll-wrapper').scroll({
				bounce: false,
				indicators: false, //是否显示滚动条
				deceleration: deceleration
			});

			$.ready(function() {
				//循环初始化所有下拉刷新，上拉加载。
				$.each(document.querySelectorAll('.mui-content'), function(index, pullRefreshEl) {
					$(pullRefreshEl).pullToRefresh({
						down: {
							callback: function() {
								var self = this;
								setTimeout(function() {
									loadNews();
									self.endPullDownToRefresh();
								}, 1000);
							}
						}
					});
				});
			});
		})(mui);

		function loadNews() {
			appElement = document.querySelector('[ng-controller=homeController]');
			$scope = angular.element(appElement).scope();
			$scope.special_topic(); //专题
			$scope.initTrade(); //交易
			$scope.initNote(); //社区
			$scope.$apply();
		}
	</script>
</html>